package com.nursinghome.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.nursinghome.group.MedicalUpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class MedicalStaff {
    private Integer mid;//医护人员 mid 主键自增
    @NotBlank(message = "工号不能为空")
    private String mno;//工号
    @NotBlank(message = "医护人员姓名不能为空")
    private String mname;//医护人员姓名
    @NotBlank(message = "医护人员性别不能为空")
    private String mgender;//医护人员的性别
    @NotBlank
    @Length(max = 11, min =5, message = "手机号长度5—11位",  groups = MedicalUpdateGroup.class)
    private String mphone;//医护人员的电话
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @NotNull(message = "入职日期不能为空")
    private Date entryDate;//入职日期
    private Integer mstate;//1在职 2离职
    @NotBlank(message = "照片不能为空", groups = MedicalUpdateGroup.class)
    private String picdir;//护工图片
    @NotBlank(message = "用户名不能为空")
    private String musername;//对应user表中的userna
    private List<Integer> serviceIds;
    private List<Elderly> elderlies;//一对多映射给护工分配老人
    private List <Service> services;


}
